package com.hgy.stack;

import java.util.ArrayList;
import java.util.List;

public class SuffixCalculatorDemo {
    public static void main(String[] args) {
        Calculator calculator = new Calculator();
        String expression = "";
        calculator.calExpression(expression);
    }
}

class Calculator{
    public Double calExpression(String expression){
        List<String> infixList = toList(expression);
        List<String> suffixList = infixToSuffix(infixList);
        Double res = calSuffixExpression(suffixList);
        return res;
    }

    //将中缀表达式字符串转换为List
    private List<String> toList(String expression){
        List<String> infix = new ArrayList<String>();
        String str = "";//用于拼接数字
        return infix;
    }

    //将中缀表达式转换为后缀表达式
    private List<String> infixToSuffix(List<String> infix){
        List<String> suffix = new ArrayList<String>();
        return suffix;
    }

    //计算后缀表达式
    private Double calSuffixExpression(List<String> suffix){
        Double res = 0.0;
        return res;
    }
}
